<template>
  <div>
    <InnerPageTable class="table" ref="valueSetTable" :config="pageTableConfig">
    </InnerPageTable>
  </div>
</template>

<script>
const columnsFn = () => {
  return [
     {
        title: '时间', 
        key: "updateTime",
        width: 180,
       
      },
      {
        title: '处理人',  
        key: "recordUser",
        width: 150,
          
      },
      {
        title: '执行项', 
        key: "logInfo" 
      },
      {
        title: '意见', 
        key: "approverComments" 
      },
  ]
}
import coverApi from '@/api/cover.js'
export default {
  name: 'revisionRecord',
  props: {
    taskId: {
      type: String,
      default: ""
    }
  },

  data() {
    return {
      pageTableConfig: {
        loadDataFn: this.getRevisionRecord,
        columns: columnsFn.bind(this)(),
        isPage: false
      }
    }
  },
  created() {
    this.$emit("SetTitle", "流程记录");
    this.$emit("SetPageMinHeight", 200);
    this.$emit("SetPageWidth", 1000);
  },

  mounted() {
    this.$refs['valueSetTable'].load({
      id: this.taskId
    })
  },

  methods: {
      getRevisionRecord: tableObj => {
      let { responseProcess, param } = tableObj
      let paramsData = param
      return coverApi.logList(paramsData).then(res => {
        let data = res.data?.data || []
        data.sort(function(a,b) {
          return (a.updateTime || 0) > (b.updateTime || 0) ? -1 : 1
        })
        responseProcess({
          records: data,
        })
      })
    },
  }
}
</script>
<style lang="less" scoped>
.table {
   min-height: 300px;
}


</style>

